/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.team1160.breakaway.api;

import edu.wpi.first.wpilibj.Joystick;

/**
 * This class contains statics channel#'s and other other useful constants
 *
 * @author Team 1160 Firebird Robotics
 */
public final class Constants {
    //constructor
    ////////////////////////////////////////////////////////////////////////////
    //this used in conjunction with the final modifier of the class makes it uninstantiable
    private Constants(){}

    //Statics Instance Fields
    ///////////////////////////////////////////////////////////////////////////

    //Driving Joysticks
    public static final int DRIVE_JOYSTICK_CHANNEL = 1;
    public static final int X_AXIS=Joystick.AxisType.kX.value+1;
    public static final int Y_AXIS=Joystick.AxisType.kY.value+1;
    public static final Integer X_AXIS_C = new Integer(X_AXIS);
    public static final Integer Y_AXIS_C = new Integer(Y_AXIS);

    public static final int TRIGGER = 1;
    public static final int TOP_BOTTOM = 2;
    public static final int TOP_CENTER = 3;
    public static final int TOP_LEFT = 4;
    public static final int TOP_RIGHT = 5;
    public static final int BOTTOM_TOP_LEFT = 6;
    public static final int BOTTOM_CENTER_LEFT = 7;
    public static final int BOTTOM_BOTTOM_LEFT = 8;
    public static final int BOTTOM_BOTTOM_RIGHT = 9;
    public static final int BOTTOM_CENTER_RIGHT = 10;
    public static final int BOTTOM_TOP_RIGHT = 11;
    
    //Left DriveTrain
    //TODO Find correct channels for left drivetrain jaguars.
    public static final int C_LEFT_DRIVE_FRONT = -1;
    public static final int C_LEFT_DRIVE_BACK = -1;
    //TODO Find correct channels for left drivetrain encoder
    public static final int C_LEFT_DRIVE_ENCODER_A = -1, C_LEFT_DRIVE_ENCODER_B = -1;

    //Right DriveTrain
    public static final int C_RIGHT_DRIVE_FRONT = -1;
    public static final int C_RIGHT_DRIVE_BACK = -1;
    //TODO Find correct channels for right drivetrain encoders
    public static final int C_RIGHT_DRIVE_ENCODER_A = -1, C_RIGHT_DRIVE_ENCODER_B = -1;

    //Dribbler
    //TODO Find correct channel for dribbler motor.
    public static final int C_DR_MOTOR = -1;
    public static final int S_DR_MOTOR = 255;//can change this

    //Jaguar Configiration Options
    public static final int J_MAX_LIMIT = 255;
    public static final int J_DEADBAND_TOP = 135;
    public static final int J_CENTER = 128;
    public static final int J_DEADBAND_BOT = 121;
    public static final int J_MIN_LIMIT = 1;

    //TODO add value for pot channel
    public static final int C_POTENTIOMETER = -1;
    
    //Motor ID components
    ////////////////////////////////////////////////////////////////////////////
    public static final byte M_DR=0;//000
    public static final byte M_DT=4;//100

    public static final byte FRONT=0;//00
    public static final byte BACK=2;//10

    public static final byte LEFT=0;//0
    public static final byte RIGHT=1;//1

    public static final byte ID_M_DR=M_DR;
    public static final byte ID_DT_M_FRONT_LEFT=M_DT|FRONT|LEFT;
    public static final byte ID_DT_M_FRONT_RIGHT=M_DT|FRONT|RIGHT;
    public static final byte ID_DT_M_BACK_LEFT=M_DT|BACK|LEFT;
    public static final byte ID_DT_M_BACK_RIGHT=M_DT|BACK|RIGHT;

    
    
    
    // example: setMotor(M_DT|FRONT|LEFT,255)
    // example: setMotor(ID_M_BACK_RIGHT,255)

    //State Constants for Model
    ///////////////////////////////////////////////////////////////////////////

    //State
    public static final byte DISABLED = 0; //0000
    public static final byte AUTONOMOUS = 8; //1000
    public static final byte TELEOP = 12; //1100

    //Function Type
    public static final byte INIT = 1; //0001
    public static final byte PERIODIC = 2; //0010
    public static final byte CONTINUOUS = 3; //0011

    //Pneumatics constants
    ////////////////////////////////////////////////////////////////////////////
    //TODO add values for these
    public static final int C_COMPRESSOR_PRESSURE_SWITCH=-1;
    public static final int C_COMPRESSOR_RELAY=-1;

    public static final int C_PISTON_FRONT=-1;
    public static final int C_PISTON_BACK=-1;

    //Servo constants
    ////////////////////////////////////////////////////////////////////////////
    //TODO add servo channel here
    public static final int C_SERVO = -1;

    //TODO get actual turn amt
    public static final double A_SERVO_TURN=1.00;

    //RobotInput Constants
    ////////////////////////////////////////////////////////////////////////////
    //TODO get gyro channel and put it here
    public static final int C_GYRO=-1;
    public static final int C_ACCEL=-1;

    //PID Constants
    ////////////////////////////////////////////////////////////////////////////
    //TODO fine tune these values
    public static final double KP=.25;
    public static final double KI=.125;
    public static final double KD=.125;
    

}
